package SQL;

import java.sql.*;

public class Conexion 
{
    public static Connection getConexion() 
    {
        Connection conexion = null;
        String driver = "oracle.jdbc.driver.OracleDriver";
        String url = "jdbc:oracle:thin:@localhost:1521:XE";
        try 
        {
            Class.forName(driver).newInstance();
            conexion = DriverManager.getConnection(url, "mstore", "123abc");
            System.out.println("Conexion a Base de Datos " + "XE" + " Ok");
        } 
        catch (Exception e) 
        {
            System.out.println("Error al tratar de abrir la base de Datos : "+e);
        }
            return conexion;
        }

        /*public Connection CerrarConexion() throws SQLException 
        {
            conexion.close();
            conexion = null;
            return conexion;
        }*/
}

